/**
    Copyright (c) 2010 yakiimo02
    Distributed under the New BSD License.
    See included license.txt or http://www.yakiimo3d.com/NewBSDLicense.txt
**/

#pragma once

/**
    @brief    Sort fragments, then blend & write to the framebuffer.
            This is a full screen pass.
    @author yakiimo02
    @date   2010/7/3
**/
class SortFragmentsAndRender
{
protected:
    struct SCREEN_VERTEX
    {
        D3DXVECTOR4 pos;
    };

public:
    SortFragmentsAndRender();
    ~SortFragmentsAndRender();

    HRESULT OnCreateDevice( ID3D11Device* pDevice );
    void    OnDestroyDevice();
    void    OnRender( ID3D11DeviceContext* pD3DContext, ID3D11Device* pDevice, const DXGI_SURFACE_DESC* pBackBufferDesc, ID3D11ShaderResourceView* pFragmentLinkSRV,
                      ID3D11ShaderResourceView* pStartOffsetSRV );

protected:
    // geometry
    ID3D11InputLayout*          m_pQuadLayout;
    ID3D11Buffer*               m_pVB;

    // shaders
    ID3D11VertexShader*            m_pVS;
    ID3D11PixelShader*            m_pPS;
};

